import { LOCAL_CONFIG } from "./local.config";
import { DEV_CONFIG } from "./development.config";
import { PROD_CONFIG } from "./production.config";
import { DEFAULT_CONFIG } from "./default.config";
import { KwConfig } from "./config.interface";

let CONFIG: KwConfig = {};

const env = process.env.NODE_ENV;

switch(env) {
  case 'production':
    CONFIG = Object.assign({}, DEFAULT_CONFIG, PROD_CONFIG);
    break;
  case 'development':
    CONFIG = Object.assign({}, DEFAULT_CONFIG, DEV_CONFIG);
    break;
  case 'local':
    CONFIG = Object.assign({}, DEFAULT_CONFIG, LOCAL_CONFIG);
    break;
  default:
    CONFIG = DEFAULT_CONFIG;
    break;
}

export default CONFIG;